<!DOCTYPE html>
<html lang="en">
<head><!--head 用来引入样式文件、JS库-->
    <meta charset="UTF-8">
    <title>watch computed</title>
    <script src="https://cdn.bootcss.com/vue/2.6.7/vue.min.js"></script>
</head>
<body>
<div id="app">
    <div v-for="item in list">{{item}}</div>
    <div v-for="item in list2">
        <div v-if="item.age > 20">{{item.name}}</div>
        <div v-else>{{item.age}}</div>

        <div v-show="item.age > 20" :style="styleMsg" :class="[{'another':'true'}]">{{item.name}}</div>
        <div v-show="item.age > 20" :style="styleMsg" :class="['actice','more',{'another':'true'}]">{{item.name}}</div>
        <div v-show="item.age > 20" :style="styleMsg" :class="['actice','more',{'another':item.age > 20}]">{{item.name}}</div>
        <div v-show="item.age > 20" :style="styleMsg" :class="['actice','more',{'another':item.age > 22}]">{{item.name}}</div>
    </div>
</div>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            msg: 'A!',
            list: [1,2,3,4,5],
            styleMsg: {color :'red'},
            list2: [{
                name: "A",
                age: 20
            },{
                name: "B",
                age: 21
            }]
        }
    })
</script>
</body>
</html>







































